package io.shentuzhigang.exam.alibaba;


import java.util.Scanner;

/**
 * @author ShenTuZhiGang
 * @version 1.0.0
 * @email 1600337300@qq.com
 * @date 2021-08-06 19:16
 */
public class Exam2021080601 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            long d = scanner.nextLong();
            long m = scanner.nextLong();
            long w = scanner.nextLong();

            long i = scanner.nextLong();
            long j = scanner.nextLong();
            long k = scanner.nextLong();
            long result = ((k - 1) * m * d % w + (j - 1) * d % w + i % w) % w;
            System.out.println((char) (96 + (result == 0 ? w : result)));
        }

    }
}
